﻿Imports Global_Visas_Business_Layer
Partial Public Class frmChangeEmailPassword

    Private Sub btnSave_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnSave.Click
        Try

            If txtpass1.Password.ToString.Trim = txtpass2.Password.ToString.Trim Then
                If CommonDataFunctions.UpdateUserEmailPassword(GlobalCRM.CurrentConName, txtpass1.Password.ToString.Trim) = True Then
                    Dim test As Singleton = Singleton.Instance
                    test.CurrentConEmailPassword = txtpass1.Password.ToString()
                    CommonFuncs.DisplayMessage("Password has been updated", CommonDialog.CustomDialogIcons.Information, "Password")
                    Me.Close()
                Else
                    CommonFuncs.DisplayMessage("Password has not been updated", CommonDialog.CustomDialogIcons.Stop, "Password")
                End If
            Else
                CommonFuncs.DisplayMessage("Password in the boxes did not match", CommonDialog.CustomDialogIcons.Stop, "Password")
            End If
        Catch ex As Exception

        End Try
    End Sub

    Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnCancel.Click
        Me.Close()
    End Sub
End Class
